package com.team.v;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.team.m.pojo.Record;
import com.team.m.pojo.State;
import com.team.p.RecordService;

/**
 * 交易记录控制类
 * 
 * @author kungfupeng
 *
 */
@Controller("recordController")
@RequestMapping("/record")
public class RecordController {

	@Autowired
	@Qualifier("recordService")
	private RecordService recordService;

	private State state = new State(false);

	@RequestMapping("/saveRecord")
	@ResponseBody
	public State saveRecord(Record record) {
		System.out.println(record+"=====");
		state.setOk(recordService.saveRecord(record));
		return state;
	}
}
